<?php
header('content-type:text/html;charset=utf-8');
include "config.php";

$username=$_POST['username'];
$pswd=$_POST['pswd'];
$id=$_POST['id'];

$sql="update user set username='{$username}',password='$pswd' where id={$id}";
if($mysqli->query($sql)){
    // 添加成功
    echo "<script>location='index.php'</script>";
}else{
    echo "<script>location='edit.php'</script>";
}
?>